<% content_for :sidebar do -%>
  <h2><%= link_to "返回#{@user.login}的页面", user_path(@user.id) %></h2>
<% end -%>

<h1><%= @user.login %>发布的活动</h1>
<% @events.each do |event| -%>
  <p><label for="event_title"><%= link_to event.title, event_path(event) %></label></p>
  <p><span class="tip">开始时间：</span><%= show_datetime event.start_at %><br />
     <span class="tip">结束时间：</span><%= show_datetime event.end_at %><br />
     <span class="tip">活动地点：</span><%= h event.location %><br />
     <span class="tip">分类：</span><%= Event.categories[event.category] %><br />
     <span class="tip">参加人数：</span><%= event.participators.count %>
  </p>
  <hr />
<% end -%>
